<%@ page import="cn.edu.lingnan.pojo.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: abc20
  Date: 2024/4/23
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="../js/admin.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/Student.css">

</head>

<body>
<header>
    <h1 >岭南师范学院学生竞赛系统管理页面----操作页面</h1>
    <hr>
</header>
<br>
<a href="/loginOut" class="link-style">注销</a>
<a href="/main.jsp" class="link-style">返回管理员首页</a>
<div class="container">
    <form action="/queryAllStu" method="get" id="stuForm">
        <input type="text" id="stuName" name="stuName" placeholder="请输入查询学生姓名">
        <input type="submit" value="查询">
    </form>
    <table>

        <tr>
            <th><input type="checkbox" onclick="allcheck(this);"></th>
            <th>学生编号</th>
            <th>学生姓名</th>
            <th>学生性别</th>
            <th>学生专业</th>
            <th>学生年级</th>
            <th>学生权限</th>
            <th>学生备注</th>
            <th><input type="submit" value="批量删除" onclick="delCheck()"></th>
        </tr>
        <%
            List<Student> allStu =(List<Student>) session.getAttribute("allStu");
            boolean flag = false;
            if(allStu!=null&&!allStu.isEmpty()){
                flag = true;
            for(Student student:allStu){
        %>
        <tr>
            <td><input type="checkbox" name="check" value=<%=student.getId()%>></td>
            <td><%=student.getId()%></td>
            <td><%=student.getName()%></td>
            <td><%=student.getGender()%></td>
            <td><%=student.getMajor()%></td>
            <td><%=student.getClassX()%></td>
            <td><%=student.getRight()%></td>
            <td><%=student.getFlag()%></td>
            <td>
                <a href="updateStu.jsp?sid=<%=student.getId()%>" class="link-style">修改</a> |
                <a href="delStu?sid=<%=student.getId()%>" class="link-style">删除</a>
            </td>
        </tr>
        <%
                }
            }
        %>
        <%
            if(!flag) { // 表格为空,flag=ture语没有被执行，则！flag成功执行，显示图片
        %>
        <img src="/images/entry2.png" alt="空空如也">
        <%
            }
        %>
    </table>
</div>

</body>
</html>
